<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" isELIgnored="false" %>
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>展示饮品信息</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/style.css" />
	</head>
	<body>
		<div id="wrap">
			<div id="top_content"> 
				<div id="header">
					<div id="rightheader">
						<p>
							2009/11/20
							<br />
						</p>
					</div>
					<div id="topheader">
						<h1 id="title">
							<a href="#">main</a> 
						</h1>
					</div>
					<div id="navigation">
					</div>
				</div>
				<div id="content">
					<p id="whereami">
					</p>
					<h1>
						Welcome!
					</h1>
					<form action="${pageContext.request.contextPath}/tea/selectLikeAll.do">
						饮品名称<input type="text" name="name"/>
						价格<input type="text" name="price"/>
						<input type="submit" value="查询"/>
					</form>
					<form method="post" action="${pageContext.request.contextPath}/tea/deleteBatch.do">
					<table class="table">
						<tr class="table_header">
						    <td>
							   	全选
							</td>
							<td>
								编号
							</td>
							<td>
								饮品名称
							</td>
							<td>
								饮品价格
							</td>
							<td>
								上架时间
							</td>
							<td>
								类别名称
							</td>
							<td>
								操作
							</td>
						</tr>
					   <c:forEach var="tea" items="${requestScope.teas.list}">
						   <tr>
							   <td>
								   <input type="checkbox" name="ids" value="${tea.tid}"/>
							   </td>
							   <td>
								   ${tea.tid}
							   </td>
							   <td>
								   ${tea.tname}
							   </td>
							   <td>
								   ${tea.tprice}
							   </td>
							   <td>
								   <fmt:formatDate value="${tea.addtime}" pattern="yyyy-MM-dd"/>
							   </td>
							   <td>

									   ${tea.category.cname}
							   </td>
							   <td>
								   <a href="${pageContext.request.contextPath}/tea/delete.do?id=${tea.tid}">删除饮品</a>&nbsp;<a href="${pageContext.request.contextPath}/tea/selectById.do?id=${tea.tid}">修改饮品</a>
							   </td>
						   </tr>

					   </c:forEach>

					</table>
					  <input type="submit" value="删除勾选项"/>
					</form>
					<p>
						<a href="${pageContext.request.contextPath}/category/selectAll.do">添加饮品</a>
						<a href="${pageContext.request.contextPath}/category/selectCategory.do">查看所有类别</a>
						<c:if test="${requestScope.teas.hasPreviousPage}">
							<a href="${pageContext.request.contextPath}/tea/selectAll.do?curPage=${requestScope.teas.prePage}">上一页</a>
						</c:if>
						<c:if test="${requestScope.teas.hasNextPage}">
							<a href="${pageContext.request.contextPath}/tea/selectAll.do?curPage=${requestScope.teas.nextPage}">下一页</a>
						</c:if>
						当前是第${requestScope.teas.pageNum}页
						总共${requestScope.teas.pages}页
					</p>
				</div>
			</div>
			<div id="footer">
				<div id="footer_bg">
				ABC@126.com
				</div>
			</div>
		</div>
	</body>
</html>
